<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<h:outputText value="TESTE" />
</h:head>

<h:body style="font-size:12px" onload="teste();">
	<script language="javascript">
		function teste(){
			var Msg = "O que voce quiser";
			document.getElementById("form:teste").value = Msg;
		}
		
		function teste2(){
			alert(document.getElementById("form:teste2").value);
			
			
		}
	</script>

	<p:layout fullPage="true">
		<p:layoutUnit position="north" size="69" resizable="false">
			<ui:include src="/visao/templates/templateHeader.xhtml" />
		</p:layoutUnit>

		<p:layoutUnit position="west" size="250" header="Menu"
			resizable="false" closable="false" collapsible="true">
			<ui:include src="/visao/templates/templateMenu.xhtml" />
		</p:layoutUnit>

		<p:layoutUnit position="center">
			<p:growl id="msgs" showDetail="true" sticky="false" life="3000" />
			<h:form id="form" title="text">
				<h:panelGrid>
				
					<h:inputHidden id="teste" />
					<h:inputHidden id="teste2" value="#{testeJavaScriptBean.teste2}" />

					<p:commandButton action="#{testeJavaScriptBean.doRecuperaValor}" onClick="teste();" value="Recuperar" ajax="false" />
					<p:commandButton action="#{testeJavaScriptBean.setValorTeste2}" onclick="teste2();" value="Seta Valor" ajax="false" />

				</h:panelGrid>
			</h:form>
		</p:layoutUnit>
	</p:layout>
</h:body>
</html>